package com.wss.day06.regex;

import java.util.regex.Pattern;

/**
 * @author wangshaoshuai
 * @desc TODO
 * @date 2025/4/26
 */
 class Person {
    private String name;
    private String gender;
    private int age;
    private String qqNumber;

    public Person(String name, String gender, int age, String qqNumber) {
        this.name = name;
        this.gender = gender;
        this.age = age;
        this.qqNumber = qqNumber;
    }

    @Override
    public String toString() {
        return "姓名: " + name + ", 性别: " + gender + ", 年龄: " + age + ", QQ 号码: " + qqNumber;
    }

    public static boolean isValidQQNumber(String qqNumber) {
        String regex = "[1-9]\\d{4,11}";
        return Pattern.matches(regex, qqNumber);
    }
}
